#ifndef AVALON_JSONDESERIALIZER_HPP
#define AVALON_JSONDESERIALIZER_HPP
#include "Avalon/Serialization/Deserializer.hpp"

namespace Avalon {
namespace Serialization {

  /*! \class JsonDeserializer
   *  \brief Implements the DataShuttle using JSON.
   */
  class JsonDeserializer : public Deserializer {
    public:

      //! Constructs a JsonDeserializer.
      JsonDeserializer();

      virtual ~JsonDeserializer();

      virtual void SetDataSource(const void* source, int size);

      virtual void Shuttle(const char* name, bool& value);

      virtual void Shuttle(const char* name, char& value);

      virtual void Shuttle(const char* name, unsigned char& value);

      virtual void Shuttle(const char* name, short& value);

      virtual void Shuttle(const char* name, unsigned short& value);

      virtual void Shuttle(const char* name, int& value);

      virtual void Shuttle(const char* name, unsigned int& value);

      virtual void Shuttle(const char* name, long& value);

      virtual void Shuttle(const char* name, unsigned long& value);

      virtual void Shuttle(const char* name, long long& value);

      virtual void Shuttle(const char* name, unsigned long long& value);

      virtual void Shuttle(const char* name, float& value);

      virtual void Shuttle(const char* name, double& value);

      virtual void Shuttle(const char* name, std::string& value);

      virtual void Shuttle(const char* name, IO::Buffer& data);

      virtual void StartStructure(const char* name);

      virtual void EndStructure();

      virtual void StartSequence(const char* name);

      virtual void EndSequence();

      using Deserializer::Shuttle;

    private:
      struct Implementation;
      boost::scoped_ptr<Implementation> m_imp;
  };
}
}

#endif // AVALON_JSONDESERIALIZER_HPP
